export const throttle = (handler: any, wait:number) => {
  let lastTime = 0
  return function (this: any, ...args: any) {
    const nowTime = new Date().getTime()
    if (nowTime - lastTime > wait) {
      handler.apply(this, args)
      lastTime = nowTime
    }
  }
}
